package com.jhws.sys.params.service;

import com.jhws.core.db.BaseDao;
import com.jhws.sys.params.bo.SysParam;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service
public class SysParamService {
    @Resource
    BaseDao BaseDao;

    public void save(SysParam param){
        BaseDao.saveOrUpdate(param);
    }

    public void delete(String name){
        BaseDao.delete(SysParam.class,name);
    }

    public SysParam getParam(String paramName){
        return BaseDao.get(SysParam.class,paramName);
    }

    public Map findParamsPageByWhere(String where){
        return BaseDao.queryPage("from SysParam where "+where);
    }

    public List<SysParam> findParamsByWhere(String where){
        return BaseDao.findList("from SysParam where 1=1 and "+where);
    }
}
